<div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
        <span aria-hidden="true">&times;</span>
    </button>
    <h4 class="modal-title">代码生成</h4>
</div>
<form id="generateEditForm" method="post" action="/generate/code">
    <div class="form-horizontal">
        <div class="modal-body">
            <div class="form-group">
                <label class="col-sm-3 control-label">表名</label>
                <div class="col-sm-6">
                    <input class="form-control required" type="text" name="tableName" value="${tableName}" readonly/>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">基础包名</label>
                <div class="col-sm-6">
                    <input class="form-control required" type="text" name="basePackageName"/>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">作者</label>
                <div class="col-sm-6">
                    <input class="form-control required" type="text" name="author"/>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">表前缀</label>
                <div class="col-sm-6">
                    <input class="form-control" type="text" name="tablePrefix"/>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label">生成结构</label>
                <div class="col-sm-6">
                    <input type="checkbox" name="chkModel" value="true" checked>Model
                    <input type="checkbox" name="chkDto" value="true" checked>Dto
                    <input type="checkbox" name="chkMapper" value="true" checked>Mapper
                    <input type="checkbox" name="chkService" value="true" checked>Service
                    <input type="checkbox" name="chkServiceImpl" value="true" checked>ServiceImpl
                    <input type="checkbox" name="chkController" value="true" checked>Controller
                </div>
            </div>

        </div>

        <div class="modal-footer">
            <button class="btn btn-primary" type="submit">生成</button>
        </div>
    </div>
</form>

<script type="text/javascript">
    $(function () {
        var data = {
            showTip: true,
            messages: {
                basePackageName: {
                    required: "基础包名不能为空！"
                },
                author: {
                    required: "作者不能为空！"
                }
            }
        };
        WValidate.init("generateEditForm", data);
    });
    
    function submit() {
        WRequest.formRequest();
    }
</script>